﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Hired
{
    public partial class viewWatchList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            gridViewWatchList.DataSource = returnWatchingList(DBJobseekerAccount.retrieveJobsByJobseekerAccountId(User.Identity.Name));
            gridViewWatchList.DataBind();
        }

        protected List<object> returnWatchingList(List<Job> listOfJobs)
        {
            return
                (from j in listOfJobs
                 select new
                 {
                     Title = j.Title,
                     Description = j.Description,
                     Location = j.Location,
                     Type = j.Type,
                     JobID = j.JobID,
                     CompanyID = j.CAccountID
                 }).ToList<object>();
        }
    }
}